package com.item.controller;


import com.item.pojo.User1;
import com.item.service.User1LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/user1")
public class User1Controller {

    @Autowired
    private User1LoginService user1LoginService;


    @PostMapping("/login")
    public String login(@RequestParam Map<String,String> map) {
        String openid;
        openid=user1LoginService.login(map);
        return openid;
    }
    @PostMapping("/person")
    public User1 Personal(@RequestParam(value = "openid") String openid){
        return user1LoginService.person(openid);

    }

    @PostMapping("/updatePerson")
    public User1 Update(@RequestParam Map<String,String> map){
        return user1LoginService.Update(map);
    }

}

